package com.itcncp.ucenter.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.itcncp.common.plugin.ToStringSerializer;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class ItcsTransJnl implements Serializable {
    /**
     * 交易流水号 出口交易数据编号（id）=21位出口车道编号+14位出口交易发生时间+2位随机流水号 
 交易发生时间YYYYMMDDHHmmss
     *
     * @mbg.generated
     */
    private String transNo;

    /**
     * 用户id 16位UDID
     *
     * @mbg.generated
     */
    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long userId;

    /**
     * 车牌号
     *
     * @mbg.generated
     */
    private String carPlate;

    /**
     * 车型 按照目前的收费要求，客车分为：ABCDE五种车型，采用1,2,3,4,5表示；暂时不分客货。
     *
     * @mbg.generated
     */
    private Byte carClass;

    /**
     * 车牌颜色，每个车牌车牌1字节表示： 1-蓝色， 2-黄色， 3-黑色， 4-白色， 5-渐变绿色 6-黄绿双拼色 7-蓝白渐变色     9-未确定
     *
     * @mbg.generated
     */
    private Byte plateColor;

    /**
     * 通行费额
     *
     * @mbg.generated
     */
    private BigDecimal tollFare;

    /**
     * 实收票价
     *
     * @mbg.generated
     */
    private BigDecimal actFare;

    /**
     * 交易时间 车道提供
     *
     * @mbg.generated
     */
    private Date tollTime;

    /**
     * itc创建时间，分区键
     *
     * @mbg.generated
     */
    private Date createTime;

    /**
     * 入口车道号 收费车道编号（id）=18收费广场编号+2位收费车道顺序码+1位保留位 
 2位数字车道顺序码，顺序码从广场通行方向自左侧为01开始排列
     *
     * @mbg.generated
     */
    private String iLaneId;

    /**
     * 收费广场编号（id）=14位收费站编号+1位收费广场类型+2位收费广场顺序码+1位保留位 
 1位收费广场类型，出入口属性 1 — 封闭式入口 2 — 封闭式出口 3 — 开放式 4 — 封闭式出+封闭式入 5 — 开放式+封闭式入 6 — 封闭式出+开放式 7 — 均一制 
 2位收费广场顺序码，顺序码从正北方位开始顺时针旋转，编号从01开始
     *
     * @mbg.generated
     */
    private String iTollPlazaId;

    /**
     * 收费站编号（id）=11位收费路段编号+2位收费站顺序码+1位保留位
     *
     * @mbg.generated
     */
    private String iStationId;

    /**
     * 出口车道号
     *
     * @mbg.generated
     */
    private String eLaneId;

    /**
     * 出口收费广场编号（id）=14位收费站编号+1位收费广场类型+2位收费广场顺序码+1位保留位
     *
     * @mbg.generated
     */
    private String eTollPlazaId;

    /**
     * 出口收费站编号（id）=11位收费路段编号+2位收费站顺序码+1位保留位
     *
     * @mbg.generated
     */
    private String eStationId;

    /**
     * 终端机编号，即通讯盒id
     *
     * @mbg.generated
     */
    private Long terminalNo;

    /**
     * 支付方代号
     *
     * @mbg.generated
     */
    private Byte payerId;

    /**
     * 支付状态  1待支付(钱包、现在支付主扫、被扫) 2支付成功(钱包、现在支付主扫、被扫) 3支付结果未知(被扫) 4订单受理成功(被扫) 5订单受理失败 9交易完成
     *
     * @mbg.generated
     */
    private Byte payState;

    /**
     * 支付时间 服务器生成
     *
     * @mbg.generated
     */
    private Date payTime;

    /**
     * 移动端app设备号
     *
     * @mbg.generated
     */
    private String deviceAppNo;

    /**
     * 是否已开发票 1、未开 2、已开票
     *
     * @mbg.generated
     */
    private Byte invoiceState;

    /**
     * 聚合订单号，现在支付的支付流水号	
     *
     * @mbg.generated
     */
    private String sOrderNo;

    /**
     * 第三方订单号
     *
     * @mbg.generated
     */
    private String dOrderNo;

    private String remark;

    private static final long serialVersionUID = 1L;

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getCarPlate() {
        return carPlate;
    }

    public void setCarPlate(String carPlate) {
        this.carPlate = carPlate;
    }

    public Byte getCarClass() {
        return carClass;
    }

    public void setCarClass(Byte carClass) {
        this.carClass = carClass;
    }

    public Byte getPlateColor() {
        return plateColor;
    }

    public void setPlateColor(Byte plateColor) {
        this.plateColor = plateColor;
    }

    public BigDecimal getTollFare() {
        return tollFare;
    }

    public void setTollFare(BigDecimal tollFare) {
        this.tollFare = tollFare;
    }

    public BigDecimal getActFare() {
        return actFare;
    }

    public void setActFare(BigDecimal actFare) {
        this.actFare = actFare;
    }

    public Date getTollTime() {
        return tollTime;
    }

    public void setTollTime(Date tollTime) {
        this.tollTime = tollTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getiLaneId() {
        return iLaneId;
    }

    public void setiLaneId(String iLaneId) {
        this.iLaneId = iLaneId;
    }

    public String getiTollPlazaId() {
        return iTollPlazaId;
    }

    public void setiTollPlazaId(String iTollPlazaId) {
        this.iTollPlazaId = iTollPlazaId;
    }

    public String getiStationId() {
        return iStationId;
    }

    public void setiStationId(String iStationId) {
        this.iStationId = iStationId;
    }

    public String geteLaneId() {
        return eLaneId;
    }

    public void seteLaneId(String eLaneId) {
        this.eLaneId = eLaneId;
    }

    public String geteTollPlazaId() {
        return eTollPlazaId;
    }

    public void seteTollPlazaId(String eTollPlazaId) {
        this.eTollPlazaId = eTollPlazaId;
    }

    public String geteStationId() {
        return eStationId;
    }

    public void seteStationId(String eStationId) {
        this.eStationId = eStationId;
    }

    public Long getTerminalNo() {
        return terminalNo;
    }

    public void setTerminalNo(Long terminalNo) {
        this.terminalNo = terminalNo;
    }

    public Byte getPayerId() {
        return payerId;
    }

    public void setPayerId(Byte payerId) {
        this.payerId = payerId;
    }

    public Byte getPayState() {
        return payState;
    }

    public void setPayState(Byte payState) {
        this.payState = payState;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getDeviceAppNo() {
        return deviceAppNo;
    }

    public void setDeviceAppNo(String deviceAppNo) {
        this.deviceAppNo = deviceAppNo;
    }

    public Byte getInvoiceState() {
        return invoiceState;
    }

    public void setInvoiceState(Byte invoiceState) {
        this.invoiceState = invoiceState;
    }

    public String getsOrderNo() {
        return sOrderNo;
    }

    public void setsOrderNo(String sOrderNo) {
        this.sOrderNo = sOrderNo;
    }

    public String getdOrderNo() {
        return dOrderNo;
    }

    public void setdOrderNo(String dOrderNo) {
        this.dOrderNo = dOrderNo;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", transNo=").append(transNo);
        sb.append(", userId=").append(userId);
        sb.append(", carPlate=").append(carPlate);
        sb.append(", carClass=").append(carClass);
        sb.append(", plateColor=").append(plateColor);
        sb.append(", tollFare=").append(tollFare);
        sb.append(", actFare=").append(actFare);
        sb.append(", tollTime=").append(tollTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", iLaneId=").append(iLaneId);
        sb.append(", iTollPlazaId=").append(iTollPlazaId);
        sb.append(", iStationId=").append(iStationId);
        sb.append(", eLaneId=").append(eLaneId);
        sb.append(", eTollPlazaId=").append(eTollPlazaId);
        sb.append(", eStationId=").append(eStationId);
        sb.append(", terminalNo=").append(terminalNo);
        sb.append(", payerId=").append(payerId);
        sb.append(", payState=").append(payState);
        sb.append(", payTime=").append(payTime);
        sb.append(", deviceAppNo=").append(deviceAppNo);
        sb.append(", invoiceState=").append(invoiceState);
        sb.append(", sOrderNo=").append(sOrderNo);
        sb.append(", dOrderNo=").append(dOrderNo);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ItcsTransJnl other = (ItcsTransJnl) that;
        return (this.getTransNo() == null ? other.getTransNo() == null : this.getTransNo().equals(other.getTransNo()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCarPlate() == null ? other.getCarPlate() == null : this.getCarPlate().equals(other.getCarPlate()))
            && (this.getCarClass() == null ? other.getCarClass() == null : this.getCarClass().equals(other.getCarClass()))
            && (this.getPlateColor() == null ? other.getPlateColor() == null : this.getPlateColor().equals(other.getPlateColor()))
            && (this.getTollFare() == null ? other.getTollFare() == null : this.getTollFare().equals(other.getTollFare()))
            && (this.getActFare() == null ? other.getActFare() == null : this.getActFare().equals(other.getActFare()))
            && (this.getTollTime() == null ? other.getTollTime() == null : this.getTollTime().equals(other.getTollTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getiLaneId() == null ? other.getiLaneId() == null : this.getiLaneId().equals(other.getiLaneId()))
            && (this.getiTollPlazaId() == null ? other.getiTollPlazaId() == null : this.getiTollPlazaId().equals(other.getiTollPlazaId()))
            && (this.getiStationId() == null ? other.getiStationId() == null : this.getiStationId().equals(other.getiStationId()))
            && (this.geteLaneId() == null ? other.geteLaneId() == null : this.geteLaneId().equals(other.geteLaneId()))
            && (this.geteTollPlazaId() == null ? other.geteTollPlazaId() == null : this.geteTollPlazaId().equals(other.geteTollPlazaId()))
            && (this.geteStationId() == null ? other.geteStationId() == null : this.geteStationId().equals(other.geteStationId()))
            && (this.getTerminalNo() == null ? other.getTerminalNo() == null : this.getTerminalNo().equals(other.getTerminalNo()))
            && (this.getPayerId() == null ? other.getPayerId() == null : this.getPayerId().equals(other.getPayerId()))
            && (this.getPayState() == null ? other.getPayState() == null : this.getPayState().equals(other.getPayState()))
            && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
            && (this.getDeviceAppNo() == null ? other.getDeviceAppNo() == null : this.getDeviceAppNo().equals(other.getDeviceAppNo()))
            && (this.getInvoiceState() == null ? other.getInvoiceState() == null : this.getInvoiceState().equals(other.getInvoiceState()))
            && (this.getsOrderNo() == null ? other.getsOrderNo() == null : this.getsOrderNo().equals(other.getsOrderNo()))
            && (this.getdOrderNo() == null ? other.getdOrderNo() == null : this.getdOrderNo().equals(other.getdOrderNo()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTransNo() == null) ? 0 : getTransNo().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCarPlate() == null) ? 0 : getCarPlate().hashCode());
        result = prime * result + ((getCarClass() == null) ? 0 : getCarClass().hashCode());
        result = prime * result + ((getPlateColor() == null) ? 0 : getPlateColor().hashCode());
        result = prime * result + ((getTollFare() == null) ? 0 : getTollFare().hashCode());
        result = prime * result + ((getActFare() == null) ? 0 : getActFare().hashCode());
        result = prime * result + ((getTollTime() == null) ? 0 : getTollTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getiLaneId() == null) ? 0 : getiLaneId().hashCode());
        result = prime * result + ((getiTollPlazaId() == null) ? 0 : getiTollPlazaId().hashCode());
        result = prime * result + ((getiStationId() == null) ? 0 : getiStationId().hashCode());
        result = prime * result + ((geteLaneId() == null) ? 0 : geteLaneId().hashCode());
        result = prime * result + ((geteTollPlazaId() == null) ? 0 : geteTollPlazaId().hashCode());
        result = prime * result + ((geteStationId() == null) ? 0 : geteStationId().hashCode());
        result = prime * result + ((getTerminalNo() == null) ? 0 : getTerminalNo().hashCode());
        result = prime * result + ((getPayerId() == null) ? 0 : getPayerId().hashCode());
        result = prime * result + ((getPayState() == null) ? 0 : getPayState().hashCode());
        result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
        result = prime * result + ((getDeviceAppNo() == null) ? 0 : getDeviceAppNo().hashCode());
        result = prime * result + ((getInvoiceState() == null) ? 0 : getInvoiceState().hashCode());
        result = prime * result + ((getsOrderNo() == null) ? 0 : getsOrderNo().hashCode());
        result = prime * result + ((getdOrderNo() == null) ? 0 : getdOrderNo().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }
}